﻿/*==========================================================================================
	TASK 8:                                                     { Operators and Expressions}
	Write an expression that calculates trapezoid's area by given sides a and b and height h.       
===========================================================================================*/

using System;

class TrapezoidArea
{
    static void Main()
    {
        Console.Write("Enter a=");
        float a = float.Parse(Console.ReadLine());
        Console.Write("Enter b=");
        float b = float.Parse(Console.ReadLine());
        Console.Write("Ehter h=");
        float h = float.Parse(Console.ReadLine());
        float area = ((a + b) / 2) * h;
        

        if ((a <= 0) || (b <= 0) || (h <= 0))
        {
            Console.WriteLine("One of enter value of a or b or h are:0 or negative!\nCorrect this to positiv number");
        }

        else
        {
            Console.WriteLine("Trapezoid's area is :{0}", area);
        }
    }
}

